From 0b1fa236fd7f6be7f0639ee321e2246f8845877a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 2 Dec 2005 19:57:36 +0000 Subject: [PATCH] Don't crash if mime_type is NULL. (#322998, Sadrul Habib Chowdhury) 2005-12-02 Matthias Clasen * gtk/gtkfilesystemunix.c (get_icon_for_mime_type): Don't crash if mime_type is NULL. (#322998, Sadrul Habib Chowdhury) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ gtk/gtkfilesystemunix.c | 3 +++ 3 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 09fc227b73..c9ae73261a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-12-02 Matthias Clasen + + * gtk/gtkfilesystemunix.c (get_icon_for_mime_type): Don't crash + if mime_type is NULL. (#322998, Sadrul Habib Chowdhury) + 2005-12-02 Michael Natterer * gtk/gtkmenu.c: applied modified patch from maemo-gtk which diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 09fc227b73..c9ae73261a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-12-02 Matthias Clasen + + * gtk/gtkfilesystemunix.c (get_icon_for_mime_type): Don't crash + if mime_type is NULL. (#322998, Sadrul Habib Chowdhury) + 2005-12-02 Michael Natterer * gtk/gtkmenu.c: applied modified patch from maemo-gtk which diff --git a/gtk/gtkfilesystemunix.c b/gtk/gtkfilesystemunix.c index 9525efcb73..ccc541a3a2 100644 --- a/gtk/gtkfilesystemunix.c +++ b/gtk/gtkfilesystemunix.c @@ -1284,6 +1284,9 @@ get_icon_for_mime_type (GtkWidget *widget, GString *icon_name; GdkPixbuf *pixbuf; + if (!mime_type) + return NULL; + separator = strchr (mime_type, '/'); if (!separator) return NULL; /* maybe we should return a GError with "invalid MIME-type" */ -- 2.30.2